﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Galaxy.AutoCAD.Tests
{
    public struct TextSpecialSymbol
    {
        public static readonly string Degree = @"\U+00B0";//度符号（°）
        public static readonly string Tolerance = @"\U+00B1";//公差符号（±）
        public static readonly string Diameter = @"\U+2205";//直径符号（φ）
        public static readonly string AlmostEqual = @"\U+2248";//几乎相等（≈）
        public static readonly string Angle = @"\U+2220";//角度（∠）
        public static readonly string Notequal = @"\U+2260";//不相等（≠）
        public static readonly string Square = @"\U+00B2";//平方
        public static readonly string Cube = @"\U+00B3";//立方
        public static readonly string Overline = @"%%o";//单行文字的上画线
        public static readonly string Underline = @"%%u";//单行文字的下画线
        public static readonly string Alpha = @"\U+03B1";//希腊字母α
        public static readonly string Belta = @"\U03B2";//希腊字母β
        public static readonly string Gamma = @"\U+03B3";//希腊字母γ
    }
    public static class TextTools
    {
        public static string StackText(string text, string supText, string subText, StackType stackType, double scale)
        {
            //设置堆叠方式所代表的字符，用于将StackType枚举转换为对应的字符
            string[] strs = new string[] { "/", "#", "^" };
            //设置堆叠文字
            return string.Format("\\Al;{0}{1}\\{2:0.#}X;\\S{3}{4}{5};{6}", text, "{", scale, supText, strs[(int)stackType], subText, "}");
        }
        public enum StackType
        {
            HorizontalFraction,//水平分数堆叠，对应于“/”
            ItalicFraction,//斜分数堆叠，对应于“#”
            Tolerance//公差堆叠，对应于“^”
        }
    }
}
